home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-04-25 | 3.3 KB | 181 lines | [TEXT/MPS ] |
- *
- * Beginning of the 'mlti' resource
- *
- * Written by: Anumele D. Raja
- *
- * Date: March 19, 1991
- *
- * Copyright @ Apple Computer, Inc. 1991
- *
- *
- * Revision History
- *
- * Raja 04/19/91 Added code to handle message dispatching
- *
- Case On
- Print Off
- Include 'Traps.a'
- Print On
- *
- * Setup - Macro to initialize address table
- *
- Macro
- Setup &Name
- Print Push, NoGen
- Import &Name
- LEA &Name, A0
- Move.L A0, D0
- _StripAddress
- Move.L D0, (A1)+
- Print Pop
- EndM
- *
- * SetupLabel - Macro to initialize address table labels
- *
- Macro
- SetupLabel &Name
- Print Push, NoGen
- Export a&Name
- a&Name Ds.L 1 ; place for the address of the routine
- Print Pop
- EndM
- *
- * Macro to generate MacsBug like symbols
- *
- Macro
- SubrName &Symbol
- String AsIs
- Dc.B &Len(&Symbol)+$80
- Dc.B '&Symbol'
- Dc.W 0
- EndM
- *
- * Entry
- *
- * Name = Name of entry point.
- *
- CallAddress Main
- *
- * Instructions to set up the table
- *
- SetupAddresses
- Lea Addresses, A1
- *
- Setup CloseQueue
- Setup FreeMsg
- Setup GetCard
- Setup GetETick
- Setup GetICCTID
- Setup GetIPCg
- Setup GetMsg
- Setup GetNameTID
- Setup GetTickPS
- Setup GetTID
- Setup IsLocal
- Setup KillReceive
- Setup LockRealArea
- Setup Lookup_Task
- Setup NetCopy
- Setup OpenQueue
- Setup Receive
- Setup Register_Task
- Setup Send
- Setup SwapTID
- Setup UnlockRealArea
-
- If &TYPE('&Dispatcher') ≠ 'UNDEFINED' Then
- Setup OpenDispatch
- Setup CloseDispatch
- EndIf
- *
- * Return the pointer to the Address table
- *
- Lea RsrcHandle, A0
- Move.L A0, D0
- Rts
- SubrName SetupAddresses
- *
- * Queue table with address of the routines
- *
- Export QueueEntry
- QueueEntry Equ *
-
- RsrcHandle Ds.L 1 ; Place to save the handle to the resource
- *
- * Address of the routines
- *
- Addresses
- *
- * There are twenty one routines in A/ROSE
- * Two routines for message dispatcher
- *
- SetupLabel CloseQueue
- SetupLabel FreeMsg
- SetupLabel GetCard
- SetupLabel GetETick
- SetupLabel GetICCTID
- SetupLabel GetIPCg
- SetupLabel GetMsg
- SetupLabel GetNameTID
- SetupLabel GetTickPS
- SetupLabel GetTID
- SetupLabel IsLocal
- SetupLabel KillReceive
- SetupLabel LockRealArea
- SetupLabel Lookup_Task
- SetupLabel NetCopy
- SetupLabel OpenQueue
- SetupLabel Receive
- SetupLabel Register_Task
- SetupLabel Send
- SetupLabel SwapTID
- SetupLabel UnlockRealArea
- *
- * Setup label for Message dispatcher calls only if the option is specified
- *
- If &TYPE('&Dispatcher') ≠ 'UNDEFINED' Then
- SetupLabel OpenDispatch
- SetupLabel CloseDispatch
- *
- * Pointer to the handle Dispatch table
- *
- Export dispatchTblHdl
- dispatchTblHdl Ds.L 1 ; Handle to the dispatch table
- *
- * Pointer to the message queue
- *
- Export messageQueueHdl
- messageQueueHdl Ds.L 1 ; Where messages are queued
- Export messageQueueSize
- messageQueueSize Ds.L 1 ; Message queue size
- *
- EndIf
- *
- Rts
- SubrName QueueEntry
- EndMain
- If &TYPE('&Dispatcher') ≠ 'UNDEFINED' Then
- *
- * Set special receive
- *
- SetSpecialReceive Proc Export
- Import SpecialReceive
- Lea SpecialReceive, A0 ; Setup the special receive address
- Lea aReceive, A1
- Move.L A0, (A1)
- Rts
- SubrName SetSpecialReceive
- EndProc
- *
- * Restore original receive
- *
- RestoreOriginalReceive Proc Export
- Import Receive
- Lea Receive, A0
- Lea aReceive, A1
- Move.L A0, (A1) ; restore original receive address
- Rts
- SubrName RestoreOriginalReceive
- EndProc
- EndIf
- End